USE [Clinic]
GO
/****** Object:  StoredProcedure [dbo].[up_UrinaUpdate]    Script Date: 01/29/2008 19:52:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_BloodPictureUpdate]
		  @BloodPictureID int
		, @Date smalldatetime
		, @HG nvarchar(50)
		, @Eritrociti nvarchar(50)
		, @Hematokrit nvarchar(50)
		, @Levkociti nvarchar(50)
		, @Mioblasti nvarchar(50)
		, @Promielobl nvarchar(50)
		, @MetaM nvarchar(50)
		, @Mladi nvarchar(50)
		, @Shtab nvarchar(50)
		, @Segm nvarchar(50)
		, @Eo nvarchar(50)
		, @Ba nvarchar(50)
		, @Mo nvarchar(50)
		, @Limfociti nvarchar(50)
		, @Plazmociti nvarchar(50)
		, @Trombociti nvarchar(50)
		, @Retikuloniti nvarchar(50)
		, @patientID int
AS
BEGIN
	SET NOCOUNT ON;
	UPDATE [BloodPicture]
	SET 
		  [Date] = @Date
		, [HG] = @HG
		, [Eritrociti] = @Eritrociti 
		, [Hematokrit ] = @Hematokrit 
		, [Levkociti ] = @Levkociti 
		, [Mioblasti ] = @Mioblasti 
		, [Promielobl] = @Promielobl 
		, [MetaM] = @MetaM 
		, [Mladi] = @Mladi 
		, [Shtab] = @Shtab 
		, [Segm] = @Segm 
		, [Eo] = @Eo 
		, [Ba] = @Ba
		, [Mo] = @Mo 
		, [Limfociti] = @Limfociti 
		, [Plazmociti ] = @Plazmociti 
		, [Trombociti] = @Trombociti
		, [Retikuloniti] = @Retikuloniti 
		, [patientID] = @patientID 
	WHERE 
		[BloodPictureID] = @BloodPictureID
END

/******    ******/
/****** Object:  StoredProcedure [dbo].[up_UrinaInsert]    Script Date: 01/15/2008 22:01:29 ******/
SET ANSI_NULLS ON


SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_BloodPictureInsert]
		  @BloodPictureID int
		, @Date smalldatetime
		, @HG nvarchar(50)
		, @Eritrociti nvarchar(50)
		, @Hematokrit nvarchar(50)
		, @Levkociti nvarchar(50)
		, @Mioblasti nvarchar(50)
		, @Promielobl nvarchar(50)
		, @MetaM nvarchar(50)
		, @Mladi nvarchar(50)
		, @Shtab nvarchar(50)
		, @Segm nvarchar(50)
		, @Eo nvarchar(50)
		, @Ba nvarchar(50)
		, @Mo nvarchar(50)
		, @Limfociti nvarchar(50)
		, @Plazmociti nvarchar(50)
		, @Trombociti nvarchar(50)
		, @Retikuloniti nvarchar(50)
		, @patientID int
AS
BEGIN
	SET NOCOUNT ON;
	INSERT INTO [BloodPicture]
	(
		  [Date]  
		, [HG]  
		, [Eritrociti] 
		, [Hematokrit]  
		, [Levkociti]  
		, [Mioblasti]  
		, [Promielobl]  
		, [MetaM] 
		, [Mladi]  
		, [Shtab]  
		, [Segm]  
		, [Eo]  
		, [Ba]  
		, [Mo]  
		, [Limfociti]  
		, [Plazmociti]  
		, [Trombociti]  
		, [Retikuloniti]  
		, [patientID]  
	) 
	VALUES 
	(
		  @Date  
		, @HG  
		, @Eritrociti 
		, @Hematokrit  
		, @Levkociti  
		, @Mioblasti  
		, @Promielobl  
		, @MetaM 
		, @Mladi  
		, @Shtab  
		, @Segm  
		, @Eo  
		, @Ba  
		, @Mo  
		, @Limfociti  
		, @Plazmociti  
		, @Trombociti  
		, @Retikuloniti  
		, @patientID  
	)		
END


SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_BloodPictureGetByPatientID]
	  @PatientID int
	
AS
BEGIN
	SET NOCOUNT ON;
	SELECT *
	FROM [BloodPicture]
	WHERE 
		[PatientID] = @PatientID
END

/****** Object:  StoredProcedure [dbo].[up_UrinaDelete]    Script Date: 01/15/2008 22:01:25 ******/
SET ANSI_NULLS ON

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_BloodPictureDelete]
	  @BloodPictureID int
	
AS
BEGIN
	SET NOCOUNT ON;
	DELETE FROM [BloodPicture]
	WHERE [BloodPictureID] = @BloodPictureID
END

/******    ******/
SET ANSI_NULLS ON